package com.zhuge_new.Adapter;

import android.app.Activity;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.Priority;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zhuge_new.Activity.CardExamineActivity;
import com.zhuge_new.R;
import com.zhuge_new.bean.CardListBean;
import com.zhuge_new.bean.ExamBean;
import com.zhuge_new.http.StringDialogCallback;
import com.zhuge_new.share.BaseHttp;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lenovo on 2018-09-11.
 */

public class CardExamineAdapter extends BaseQuickAdapter<ExamBean.CreditcardsBean,BaseViewHolder> {


    private Context context;
    private String card;
    private ExamBean examBean;
    public CardExamineAdapter(Context context, ExamBean examBean) {
        super(R.layout.item_examine,examBean.getCreditcards());
        this.context=context;
        this.examBean=examBean;
    }

    @Override
    public int getItemCount() {

        return examBean.getCreditcards().size()+getFooterLayoutCount();
    }

    @Override
    protected void convert(BaseViewHolder helper, ExamBean.CreditcardsBean item) {
        ImageView iv_yhlogo=helper.getView(R.id.iv_yhlogo);
        String logourl=item.getLogoUrl();
        RequestOptions options=new RequestOptions()
                .centerCrop()
                .placeholder(R.mipmap.ic_launcher_round)
                .placeholder(R.mipmap.ic_launcher_round)
                .priority(Priority.HIGH);
        Glide.with(context).load(BaseHttp.baseImg1+logourl).apply(options).into(iv_yhlogo);

        helper.setText(R.id.card_name,item.getBank());
        helper.setText(R.id.card_No,"**** **** **** **** "+item.getCreditcardSuf());
        helper.addOnClickListener(R.id.card_delete);
    }

    @Override
    public void remove(int position) {
        super.remove(position);
    }
}
